import { getValideCode } from '@/apis/system/user';
import { useMessage } from 'naive-ui';
import { ref } from 'vue';

/**
 * 获取验证码
 * @returns
 */
export const useGetCaptcha = async () => {
  const uuid = ref('');
  const img = ref('');

  const res = await getValideCode();
  uuid.value = res.data.uuid;
  img.value = `data:image/png;base64,${res.data.img}`;
  return {
    uuid,
    img,
  };
};
